package com.happy.study.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.happy.study.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<UserEntity> {

    @Select (value = "select ui.id, ui.userName, ui.password, ui.nickName, ui.phone, ui.email, ui.company, ui.address, ui.sign, ui.openid, ui.sex, ui.country, ui.province, ui.city, fi.fileUrl AS headimgurl, ui.createTime, ui.changeTime, ui.isUsed from user_info ui left join file_info fi on fi.userId = ui.id and fi.type = 1 where ui.id=#{id}")
    UserEntity queryById ( int id );

}
